home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 31 / Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso / -coverdisks- / 115a / ppt / rexx / zoom.prx < prev   
Text File  |  1998-07-29  |  1KB  |  71 lines

  1. /*
  2.     This creates a simple effect where it seems you have zoomed
  3.  
  4.     $Id:$
  5. */
  6.  
  7. /*-------------------------------------------------------------------*/
  8. /*  I suggest you use this header as-is and add your own code below  */
  9.  
  10. OPTIONS RESULTS
  11. SIGNAL ON ERROR
  12. IF ADDRESS() = REXX THEN DO
  13.     startedfromcli = 1
  14.     ADDRESS PPT
  15. END
  16. ELSE DO
  17.     startedfromcli = 0
  18.     ADDRESS PPT
  19. END
  20. RESULT = 'no result'
  21.  
  22. /*-------------------------------------------------------------------*/
  23. /* Add your code here */
  24.  
  25. PARSE ARG frame
  26.  
  27. IF DATATYPE(frame) ~= NUM THEN DO
  28.     RC  = 10
  29.     RC2 = "No frame selected"
  30.     SIGNAL ERROR
  31. END
  32.  
  33. FRAMEINFO frame STEM inf
  34.  
  35. perc.type = SLIDER
  36. perc.min  = 1
  37. perc.max  = 99
  38. perc.default = 85
  39. perc.label = "Area (%)"
  40.  
  41. ASKREQ '"Area to zoom in?"' perc
  42.  
  43. IF RESULT = 0 THEN DO
  44.     COPYFRAME frame
  45.     newframe = RESULT
  46.  
  47.     ntop  = (100-perc.value)/2 * inf.height % 100
  48.     nleft = (100-perc.value)/2 * inf.width % 100
  49.  
  50.     PROCESS frame BRIGHTNESS '-0.3'
  51.     PROCESS newframe SCALE NEWWIDTH perc.value NEWHEIGHT perc.value PERCENT
  52.     PROCESS frame COMPOSITE WITH newframe TOP ntop LEFT nleft METHOD 'Direct'
  53.     DELETEFRAME newframe FORCE
  54. END
  55.  
  56. EXIT 0
  57.  
  58. /*-------------------------------------------------------------------*/
  59. /* Again, keep this part intact. This is the error handler. */
  60. ERROR :
  61. returncode = RC
  62. IF startedfromcli = 1 THEN DO
  63.     SAY 'ERROR ' returncode ' on line ' SIGL ': ' RC2
  64.     PPT_TO_BACK
  65. END
  66. ELSE
  67.     SHOWERROR '"'RC2'"' SIGL
  68. EXIT returncode
  69.  
  70.  
  71.